#include<bits/stdc++.h>
using namespace std;

struct node
{
	string name, sex;
	int score;
}stu[1000];

int sc[1000];

int main()
{
	int n;
	cin>>n;
	for(int i = 1;i <= n;i++)
	{
		cin>>stu[i].name>>stu[i].sex>>stu[i].score;
		sc[i] = stu[i].score;
	}
	
	double aver = (double)accumulate(sc+1, sc+n+1, 0)/n;
	int cntM, cntW;
	cntM = cntW = 0;
	for(int i = 1;i <= n;i++)
		if(stu[i].score > aver)
			stu[i].sex == "W" ? cntW++ : cntM++;
	cout<<fixed<<setprecision(1)<<aver<<" "<<cntM<<" "<<cntW;
	return 0;
}

